<!--
 * @Author: HeAo
 * @Date: 2022-08-24 19:45:36
 * @LastEditTime: 2022-08-24 19:46:47
 * @LastEditors: HeAo
 * @Description: 
 * @FilePath: \JavaScripe\day-13事件机制\09-鼠标事件.html
 * 别乱动！
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    #div1 {
      width: 300px;
      height: 300px;
      background-color: aqua;
    }
  </style>
</head>

<body>
  <div id="div1"></div>
  <script>
    var div1 = document.getElementById('div1')
    // 单击事件
    div1.onclick = function () {
      console.log('单击');
    }
    // 双击事件
    div1.ondblclick = function () {
      console.log('双击触发');
    }
    // 鼠标移入
    div1.onmouseenter = function () {
      console.log('鼠标移入');
    }
    // 鼠标移出
    div1.onmouseleave = function () {
      console.log('鼠标移出');
    }
  </script>


</body>

</html>